<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link rel="stylesheet" href="<?php echo $this->baseUrl;?>/files/admin/css/main.css" />
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/jquery.js"></script>
<script language="javascript" src="<?php echo $this->baseUrl;?>/files/admin/js/load.js"></script>
</head>

<body>
	<div id="main">
		<div id="navigation">当前位置：<a href="<?php echo $this->projectUrl(array('action'=>'index-admin')) ;?>">渠道申请列表</a> &gt; <span id="focus">审核申请</span></div>
  <div id="body">
			<div id="edit">
				<form id="editForm" name="editForm" method="post" action="">
					<table class="table">
						<tr class="dataLine">
						  <td width="23%">渠道的编号：</td>
						  <td width="77%"><?php echo $this->row['memberCode'];?></td>
					  </tr>
						<tr class="dataLine">
						  <td>选择产品：</td>
						  <td>
                       
                          <?php echo $this->row['productCode'];?>                          </td>
					  </tr>
						<tr class="dataLine">
						  <td>操作系统：</td>
						  <td>
                    
                          <?php echo $this->row['osName'];?>                         </td>
					  </tr>
						<tr class="dataLine">
							<td height="19"><p >软件包数量：</p>						    </td>
							<td>
                            <?php echo $this->row['applyNum'];?>                            </td>
						</tr>
						<tr class="dataLine">
							<td>备注：</td>
							<td>
                            <?php echo $this->row['applyNotes'];?>                           </td>
						</tr>
						<tr class="dataLine">
						  <td height="22">审核状态：</td>
						  <td><input type="radio" name="status" id="radio" value="1" 
                          class="radioChangeStatus"
                          <?php if($this->row['status']=="1"):?>
                            checked="checked"
                          <?php endif;?>
                           />
						    未处理待审核						  &nbsp;&nbsp;
  <input type="radio" name="status" id="radio2" value="2"
  class="radioChangeStatus"
  						 <?php if($this->row['status']=="2"):?>
                            checked="checked"
                          <?php endif;?>
   />
已审核未通过&nbsp;&nbsp;&nbsp;
<input type="radio" name="status" id="radio3" value="3"
class="radioChangeStatus"
                          <?php if($this->row['status']=="3"):?>
                            checked="checked"
                          <?php endif;?> />
已审核待打包</td>
					  </tr>
						<tr class="dataLine setManager" style="display:none;">
						  <td>打包人员：
					      <input type="hidden" name="defautl_appUploadUserName" id="defautl_appUploadUserName" value="<?php echo $this->row['appUploadUserName'];?>" /></td>
						  <td>						    角色：
                            <select name="role_upload" id="role_upload" style="width:150px;">
                            <option value="">选择</option>
                            <?php foreach($this->roles as $role):?>
                            	<option value="<?php echo $role['id'];?>"><?php echo $role['name'];?></option>
                            <?php endforeach;?>
</select>
					      &nbsp;&nbsp;&nbsp;&nbsp;用户：
					      <select name="appUploadUserName" id="appUploadUserName" style="width:150px;">
                          <?php if($this->row['appUploadUserName']):?>
                          <option value="<?php echo $this->row['appUploadUserName'];?>"><?php echo $this->row['appUploadUserName'];?></option>
                          <?php else:?>
                          <option value="">选择</option>
                          <?php endif;?>
				          </select></td>
					  </tr>
						<tr class="dataLine setManager" style="display:none;">
						  <td>测试人员：
					      <input type="hidden" name="defautl_appTestUserName" id="defautl_appTestUserName" value="<?php echo $this->row['appTestUserName'];?>" /></td>
						  <td>角色：
						    <select name="role_test" id="role_test" style="width:150px;">
                            <option value="">选择</option>
                              <?php foreach($this->roles as $role):?>
                            	<option value="<?php echo $role['id'];?>"><?php echo $role['name'];?></option>
                            <?php endforeach;?>
				          </select>
					      &nbsp;&nbsp;&nbsp;&nbsp;用户：
					      <select name="appTestUserName" id="appTestUserName" style="width:150px;">
				          
                           <?php if($this->row['appTestUserName']):?>
                          <option value="<?php echo $this->row['appTestUserName'];?>"><?php echo $this->row['appTestUserName'];?></option>
                          <?php else:?>
                          <option value="">选择</option>
                          <?php endif;?>
                          
                          </select></td>
					  </tr>
						<tr class="dataLine">
						  <td>审核意见：</td>
						  <td><textarea name="checkNotes" cols="30" rows="5" class="input" id="checkNotes" style="width:300px;"><?php echo $this->row['checkNotes'];?></textarea>
					      <input type="hidden" name="backUrl" id="backUrl" value="<?php echo $this->projectUrl(array('controller'=>'source','action'=>'index-admin'));?>" /></td>
					  </tr>
						<tr class="dataLine">
							<td>&nbsp;</td>
							<td><input type="submit" name="button" id="button" value="提交" class="button" /></td>
						</tr>
					</table>
			  </form>
			</div>
		</div>
</div>

<script>
$(function(){
		   	$(".radioChangeStatus").click(function(){
								if($(this).attr("checked")==true && $(this).val()=="3")
								{
									$(".setManager").show();
								}
								else
								{
									$(".setManager").hide();
								}
										
					})
		   })
</script>

<!-- 有角色获取用户名，上传人员 -->
<script>
$(function(){
	$("#role_upload").change(function(){
	var self=$("#appUploadUserName")[0];
		 $.ajax({ url: "<?php echo $this->projectUrl(array('action'=>'get-user-names-by-role-id'));?>",
              type:"post",           
             dataType:"json",
             data: "roleId="+$("#role_upload option:selected").val(),
             success:function(data){ 
			 			
			 						self.options.length=0;
									self.options[0] = new Option('选择', '');
									var default_osName=$("#default_appUploadUserName").val();
                                   $.each(data,function(i){
								   	self.options[i+1] = new Option(data[i], data[i]);
								   		 if(default_osName==data[i]) {										 
										 	self.options[i+1].selected=true;																					
										 } 
											  }); 
								  
                              } 
         });
	
	
	
	})
	
	$("#role_upload").change();
	
})
</script>
<!-- 有角色获取用户名，上传人员 -->


<!-- 有角色获取用户名，测试人员 -->
<script>
$(function(){
	$("#role_test").change(function(){
	var self=$("#appTestUserName")[0];
		 $.ajax({ url: "<?php echo $this->projectUrl(array('action'=>'get-user-names-by-role-id'));?>",
              type:"post",           
             dataType:"json",
             data: "roleId="+$("#role_test option:selected").val(),
             success:function(data){ 
			 			
			 						self.options.length=0;
									self.options[0] = new Option('选择', '');
									var default_osName=$("#default_appTestUserName").val();
                                   $.each(data,function(i){
								   	self.options[i+1] = new Option(data[i], data[i]);
								   		 if(default_osName==data[i]) {										 
										 	self.options[i+1].selected=true;																					
										 } 
											  }); 
								  
                              } 
         });
	
	
	
	})
	
	$("#role_test").change();
	
})
</script>
<!-- 有角色获取用户名，测试人员 -->
</body>
</html>